// pages/admin/adminORD/adminORD.js
import {
  exchangeDetails
} from '../../../api/index'


Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 商品数据 推荐
    recommendArr: [],
    // 订单数据
    ORDdata: {}
  },
  onLoad(play) {
    let ORDdata = wx.getStorageSync('ordData')
    if (ORDdata) {
      ORDdata = JSON.parse(ORDdata)
      this.setData({
        ORDdata
      })
    }
    this.getOrdCom()
  },
  // 获取订单详情商品
  async getOrdCom() {
    try {
      const that = this
      const dataObj = await exchangeDetails({
        id: that.data.ORDdata.id
      })
      console.log("订单详情查询结果：", dataObj);
      if (dataObj.code == 200) {
        this.setData({
          recommendArr: dataObj.data
        })
      }
    } catch (error) {
      console.log("获取订单详情错误");
    }
  },
})